package de.fmannan.wildit.persistence;

import java.text.ParseException;
import java.util.Calendar;
import java.util.Collection;
import java.util.NoSuchElementException;

import de.fmannan.wildit.domainmodel.Alarm;
import de.fmannan.wildit.domainmodel.AlarmType;

/**
 * Implemented by persistence providers. Determines an array of methods which
 * must be supported by a persistence provider.
 * 
 * @author fmannan
 * 
 */
public interface PersistenceAdapter {
    
    	
	public long addAlarm(Alarm alarm);
	
	public Collection<Alarm> getAlarms(AlarmType filter) throws ParseException;

	public Alarm getAlarm(int id) throws NoSuchElementException, ParseException;

	public void setAlarmStartTime(int id, Calendar newTime);

	public void setAlarmEndTime(int id, Calendar newTime);

	public void setAlarmInterval(int id, Calendar newInterval);

	public Calendar getAlarmStartTime(int id);

	public Calendar getAlarmEndTime(int id);

	public Calendar getAlarmInterval(int id);
	
	public boolean isEnabled (int id);
	
	public void setEnabled (int id, boolean value);
	
	public AlarmType getType(int id);
}
